package sytwo;
public class Teacher {
    private String teacherId;    // 教师编号
    private String name;         // 姓名
    private String gender;       // 性别
    private Course taughtCourse; // 所授课程
    // 构造方法
    public Teacher(String teacherId, String name, String gender) {
        this.teacherId = teacherId;
        this.name = name;
        this.gender = gender;
    }
    // 开设课程的方法
    public void openCourse(Course course) {
        this.taughtCourse = course;
        System.out.println(name + "老师开设了课程《" + course.getCourseName() + "》");
    }
    // Getter方法
    public String getTeacherId() {
        return teacherId;
    }
    public String getName() {
        return name;
    }
    public Course getTaughtCourse() {
        return taughtCourse;
    }
}